using RealtimeCollabGame.Domain.ValueObjects;

namespace RealtimeCollabGame.Domain.ValueObjects;

public record PlayerScore(Guid PlayerId, string PlayerName, PlayerColor Color, int Area)
{
    public int Rank { get; set; }
    
    public double Percentage { get; set; }
    
    public void CalculatePercentage(int totalArea)
    {
        Percentage = totalArea > 0 ? (double)Area / totalArea * 100 : 0;
    }
} 